<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@page import="com.skycode7.dao.AdminDao" %>
<%
    request.setCharacterEncoding("UTF-8");
    String Action = request.getParameter("Action");
    if (Action != null && Action.equals("Login")) {
        // 如果参数不为空 且 等于Login 点击”登录“进入的当前页面
        String User = request.getParameter("User");
        String Pwd = request.getParameter("Pwd");
        AdminDao adminDao = new AdminDao();//实例化Admin类
        boolean isOk = adminDao.CheckLogin(User,Pwd);
        if(isOk){
            out.print("<script>aler('登录成功！');" +
                    "location.href='news.jsp'"+
                    "</script>");
        }else{
            out.print("<script>aler('登录失败！');" +
                    "location.href='login.jsp'"+
                    "</script>");
        }

    }
%>
<!DOCTYPE>
<html>
<head>
    <title>后台-天码行空学习建站</title>
    <link rel="stylesheet" href="static/css/amazeui.min.css"/>
    <script src="static/js/main.js"></script>
</head>
<body style="background: url(static/img/login-bg.png) no-repeat">
    <div class="header" style="text-align: center;margin-top: 100px">
        <div class="am-g">
            <img src="static/img/loginTitle.png">
        </div>
    </div>
    <div class="am-g" style="margin-top: 20px">
        <div class="am-u-lg-6 am-u-md-10 am-u-sm-center"
        style="background: url(static/img/loginForm.png) no-repeat;height: 479px;width: 695px;">
            <form action="login.jsp" method="post" class="am-form login-form" style="padding: 50px 0px 0px 120px;width: 550px">

            </form>
        </div>
    </div>
</body>
</html>
